﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Jzy.BLL.Project;
using Jzy.Model.Project;
using Jzy.Core.Common.Web;
using Frame.Lib.Utilities;

public partial class Project_Task_Detail : PageDetail
{
    private string TaskID
    {
        get
        {
            return StrUtil.DecryptUrl(Request["TaskID"]);
        }
    }

    private string PrjID
    {
        get
        {
            return StrUtil.DecryptUrl(Request["PrjID"]);
        }
    }

    private PrjTaskBO _task;
    protected void Page_Load(object sender, EventArgs e)
    {
        _task = new PrjTaskBO(int.Parse(PrjID));
        if (!IsPostBack)
        {
            DispInfo();
        }
    }

    private void DispInfo()
    {
        PrjTaskInfo info = _task.GetInfo(TaskID);
        EntityUtil.SetControl(pnlMain, info);

        StartTime.Text = info.StartTime.ToString("yyyy-MM-dd");
        EndTime.Text = info.EndTime.ToString("yyyy-MM-dd");

        UpperName.Text  = _task.GetName(info.UpperID);
        PrjName.Text = (new ProjectBO()).GetName(PrjID);

        IsMilestone.Text = info.IsMilestone ? "是" : "否";

        TaskChangeBO change = new TaskChangeBO();
        ChangeCount.Text = change.GetChangeCount(TaskID).ToString();

    }
}
